package com.cta.view.json;

import java.util.List;

public class JsonObject<T> {

	private boolean success;
	private List<T> results;
	private T result;

	public JsonObject(boolean suc, List<T> re) {
		this.success = suc;
		this.results = re;
	}

	public JsonObject(boolean suc, List<T> re, T r) {
		this.success = suc;
		this.results = re;
		this.result = r;
	}

	public boolean isSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public List<T> getResults() {
		return results;
	}

	public void setResults(List<T> results) {
		this.results = results;
	}

	public T getResult() {
		return result;
	}

	public void setResult(T result) {
		this.result = result;
	}

	public static <T> JsonObject<T> newJsonObject(boolean suc, List<T> re) {
		return new JsonObject<T>(suc, re);
	}

	public static <T> JsonObject<T> newJsonObject(boolean suc, T re) {
		return new JsonObject<T>(suc, null, re);
	}

	public static <T> JsonObject<T> emptyJsonObject() {
		return new JsonObject<T>(false, null);
	}
}
